#include "geovalue.h"
#include "cartesian_grid.h"

template<class cartesian_grid>
geovalue::property_type& geovalue::property_value() {
  assert(is_informed());
  return grid_->prop_value_at(index_);
}

template<class cartesian_grid>
 const geovalue::property_type& geovalue::property_value() const{
  assert(is_informed());
  return grid_->prop_value_at(index_);
}

template<class cartesian_grid>
geovalue::location_type geovalue::location() {
  assert(is_informed());
  return grid_->location_of(index_);
}

template<class cartesian_grid>
 const geovalue::location_type geovalue::location()  const{
  assert(is_informed());
  return grid_->location_of(index_);
}

template<class cartesian_grid>
bool geovalue::is_informed() const{
  return index_ < grid_->size();
}

